﻿@model IEnumerable<Hostal.Bussines.Entities.Insumo>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>

@using (Html.BeginForm())
{
    <fieldset>
        <legend>Buscar Tipo de Habitaciones</legend>
        <table>
            <tr>
                <td><b>Criterio:</b></td>
                <td>@Html.TextBox("criterio")</td>
                <td><input type="submit" name="btnBuscar" value="Buscar" /></td>
            </tr>
        </table>    
        
    </fieldset>
}
<table>
    <tr>
        <th>
            <b>ID</b>
        </th>
        <th>
            <b>PROVEEDOR</b>
        </th>
        <th>
           <b>NOMBRE</b>
        </th>
        <th>
            <b>STOCK</b>
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.IdInsumos)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Proveedore.RazonSocial)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Nombre)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Stock)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.IdInsumos  }) |           
            @Html.ActionLink("Delete", "Delete", new { id = item.IdInsumos },
            new { onClick= "return confirm('Desea eliminar Insumo: " + @item.Nombre + "?');"})
        </td>
    </tr>
}

</table>
